package tyk;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class Student implements InitializingBean, DisposableBean {
    private Integer number;
    private String name;

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        System.out.println("2.执行setter方法设置Student的属性值");
    }

    public Student() {
        System.out.println("1.执行静态方法创建Student对象并分配内存");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("7.执行销毁方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("4.执行属性设置好后的初始化方法");
    }
}
